package com.example.pets_java.service;

import com.example.pets_java.mapper.PetDiaryMapper;
import com.example.pets_java.pojo.PetDiary;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PetDiaryService {

    @Autowired
    private PetDiaryMapper petDiaryMapper;

    public List<PetDiary> getDiariesByPetId(int petId) {
        return petDiaryMapper.findByPetId(petId);
    }

    public void addDiary(PetDiary petDiary) {
        petDiaryMapper.insert(petDiary);
    }
}
